<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>优速宝</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
</head>
<style>
    .b-con {
        width: 100%;
        top: 50%;
        left: 50%;
        position: fixed;
        -webkit-transform: translate(-50%, -50%);
        transform: translate(-50%, -50%);
        box-sizing: border-box;
        text-align: center;
    }

    .db {
        display: block;
        text-align: center;
    }

    .logo {
        width: 70%;
        margin-bottom: 20px;
    }

    .o-logo {
        width:15%;
        margin-bottom: 50px;
    }
    .btn{
        text-decoration: none;
        color: white;
        width: 80%;
        background-color: #EE7800;
        outline: none;
        border-radius: 15px;
        line-height: 2.2;
        vertical-align: middle;
        margin:0 auto;
        -webkit-transition: all 0.3s;
    }
    .btn:active{
        opacity: 0.7;
        transform: scale(1.08);
        -webkit-transform: scale(1.08);
    }
    .wx-guide {
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        right: 0;
        z-index: 10;
        height: 100%;
        width: 100%;
    }
</style>
<body>
<div class="b-con">
    <div class="db">
        <img class="logo" src="uclogo.png">
    </div>

    <div class="db">
        <img class="o-logo" src="logo.png">
    </div>
    <div class="db">
        <a class="db btn" onclick="initDownload()"
           href="#">立即更新</a>
    </div>
</div>
<img src="lead@2x.png" id="wx" class="wx-guide">
<script>
    //iphone下载地址
    var iphoneDownloadUrl = "itms-services://?action=download-manifest&url=https://git.oschina.net/GhostStrong/JKLearn/raw/master/test/manifest.plist";
    //安卓下载地址
    var androidDownloadUrl = "http://t1-bms.uc56.com/uce-bms-web/deviceVersion/downloadVersion.do?file=ucb-android.apk";

    window.onload = function () {
        var wxel = document.getElementById("wx");
        wxel.addEventListener("click", function () {
            wxel.style.display = "none";
        });
        if (isWeiXin()) {
            wxel.style.display = "block";
        } else {
            wxel.style.display = "none";
        }
        initDownload();
    };
    //根据机型下载
    function initDownload() {
        var u = navigator.userAgent;
        if (u.indexOf('Android') > -1 || u.indexOf('Linux') > -1) {//安卓手机
            window.location.href = androidDownloadUrl;
        } else if (u.indexOf('iPhone') > -1) {//苹果手机
            window.location.href = iphoneDownloadUrl;
            return;
        } else if (u.indexOf('Windows Phone') > -1) {//winphone手机
            window.location.href = androidDownloadUrl;
            return;
        }
    }

    function isWeiXin() {
        var ua = window.navigator.userAgent.toLowerCase();
        if (ua.match(/MicroMessenger/i) == 'micromessenger') {
            return true;
        } else {
            return false;
        }
    }
</script>
</body>
</html>
